package com.whw.fy.service.impl;

import com.whw.fy.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.whw.fy.entity.ClazzType;
import com.whw.fy.mapper.ClazzTypeMapper;
import com.whw.fy.service.ClazzTypeService;
@Service
public class ClazzTypeServiceImpl implements ClazzTypeService{

    @Resource
    private ClazzTypeMapper clazzTypeMapper;

    @Override
    public Message deleteByPrimaryKey(Integer clazzTypeId) {
        return clazzTypeMapper.deleteByPrimaryKey(clazzTypeId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insert(ClazzType record) {
        return clazzTypeMapper.insert(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(ClazzType record) {
        return clazzTypeMapper.insertSelective(record)> 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer clazzTypeId) {
        return Message.success(null).add(clazzTypeMapper.selectByPrimaryKey(clazzTypeId));
    }

    @Override
    public Message updateByPrimaryKeySelective(ClazzType record) {
        return clazzTypeMapper.updateByPrimaryKeySelective(record)> 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(ClazzType record) {
        return clazzTypeMapper.updateByPrimaryKey(record)> 0 ? Message.success(null) : Message.fail(null);
    }

   @Override
    public  Message selectByClazzTypeId(int clazzTypeId){
       return Message.success(null).add(clazzTypeMapper.selectByClazzTypeId(clazzTypeId));
   }

    @Override
    public Message selectClassNameByClazzTypeId(Integer clazzTypeId) {
        return Message.success(null).add(clazzTypeMapper.selectClassNameByClazzTypeId(clazzTypeId));
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(clazzTypeMapper.selectAll());
    }


}
